1. Field of the Invention
The present invention relates to an image processing apparatus, a control method therefor, and a computer-readable storage medium storing a program for implementing the method.
2. Description of the Related Art
In recent years, when documents are created, advanced functions of, for example, not only entering characters but also decorating fonts, freely creating drawings, or capturing photographs have been used.
As objects to be created become more advanced, the amount of effort required for creating an entirely new document increases. Thus, it is desired that part of documents created in the past are rendered reusable as it is or after being processed and edited as much as possible.
Also, there have been increasing occasions where documents are electronically distributed due to proliferation of networks typified by the Internet, but in many cases, electronic documents are distributed as sheet documents printed on sheets.
There have been developed techniques to, even when there is only a sheet document at hand, obtain contents of the sheet document as reusable data.
As for sheet document data, for example, a technique that when a sheet document is electronically scanned in, a document that matches contents of the sheet document is retrieved from a database so that the document can be used in place of the scanned-in sheet document (see, for example, Japanese Laid-Open Patent Publication (Kokai) No. 2004-265384).
On the other hand, when no document matching the contents of the sheet document can be retrieved from the database, the contents of the sheet document are converted into easily-reusable electronic data, and hence in this case as well, the contents of the sheet document can be reused.
Examples of such techniques to convert character information in a document image into easily-reusable electronic data include an OCR technique. Also, examples of techniques to convert graphic information comprised of lines and planes into easily-reusable data include a vectorization technique.
Japanese Laid-Open Patent Publication (Kokai) No. 2004-265384 discloses a technique to convert characters in a document image into reusable data by converting them into character codes or vectorizing outlines of graphics using any of the above techniques.
Further, Japanese Laid-Open Patent Publication (Kokai) No. 2004-265384 discloses a technique to construct data that identifies areas such as characters, line drawings, natural images, and tables in a document image and expresses the relationship among the areas in the form of a tree structure.
This technique arranges the character codes, vector data, image data, and so on according to the tree structure to enable conversion into electronic document pages that can be edited using applications.
Data thus obtained has a layout similar to that of the original document, and as with electronic document pages newly created using a document creating application or the like, the data can easily be subjected to changing of positions and sizes of characters and graphics as well as geometric deformation, coloring, and so on.
Also, there have been techniques to recognize structures of tabular areas in document images. For example, there has been disclosed a technique to obtain a matrix structure comprised of rectangular frame areas in a table (see, for example, Japanese Laid-Open Patent Publication (Kokai) No. H01-129358).
By combining a matrix structure of frame areas obtained using this technique and OCR results of in-frame characters obtained using the above technique, a table area in a document image into electronic data having a table structure.
According to the conventional techniques described above, an original image can be divided into foreground images, which represent vector data or cut-out images (areas (objects) such as characters, line drawings, natural images, and tables) and a background image.
The background image is generated by deleting, from the original image, pixel information in areas where the foreground images are present.
FIGS. 6A and 6B are views useful in explaining a background image, in which FIG. 6A shows an original image, and FIG. 6B shows a background image.
Line drawing portion pixels of line drawing portions in FIG. 6A, that is, character pixel clusters 601 to 603, a line drawing pixel cluster 608, and a table frame cluster 604 are filled with a surrounding pixel color in the background image of FIG. 6B.
As for a natural image area 609, the entire rectangular area thereof is filled with a surrounding pixel color.
In relation to such a background image, there is known a function of generating data without adding a background image so as to increase reusability for a user.
When this function is enabled, no data is generated for a page whose image includes no foreground image such as character data, and hence the page (image) itself is not output.
Therefore, the problem that the page count of originals and the page count of generated data are different will arise. When the page counts are different, and further, the number of originals is large, it is difficult to know which page is missing.
Moreover, when a person who holds originals and a person who receives a document in data format are different, the person who receives the document does not know that there is a page missing.